/*
 * application.cpp
 *
 *  Created on: 17 Oca 2012
 *      Author: root
 */

#include "application.h"
#include "messaging/messaging_pipe.h"

namespace androidplus {

application *application::singleton = NULL;

application::application() {

    current_messaging=new messaging::messaging_pipe;




}
activity * application::cur_activity()
{
	return current_activity;
}

application::~application() {

	LOGI("Application deconstructer called");

      delete current_messaging;
      current_messaging=NULL;
      singleton=NULL;
}
void application::init(activity *act)
{
	current_activity=act;
	current_activity->current_messaging=current_messaging;
}



androidplus::application * const androidplus::application::cur_app() {
	if (application::singleton == NULL)
		application::singleton = new application;

	return application::singleton;
}









} /* namespace AndroidPlus */



